<?php
include './../../common.inc.php';
function check($str,$name){
	if(PCache::read($str.'.php')){
		echo "<p style='color:#007130'>".$name."读取成功&nbsp;&nbsp;&nbsp;$str.php</p>";
	}else{
		echo "<p style='color:#f00'>".$name."读取失败&nbsp;&nbsp;&nbsp;$str.php</p>";
	}
}

check('module','模块缓存');
echo '<hr>';
check('area','地区缓存');
echo '<hr>';
check('pay','支付系统配置缓存');
echo '<hr>';
foreach ($MODULE as $moduleid => $module) {
	check('module-'.$moduleid,$module['name'].'[模块]缓存');
}
echo '<hr>';
foreach ($MODULE as $moduleid => $module) {
	check('category-'.$moduleid,$module['name'].'[分类]缓存');
	check('catetree-'.$moduleid,$module['name'].'[分类树]缓存');
}
echo '<hr>';
check('group','会员组缓存');
check('grouporder','会员组排序缓存');
echo '<hr>';
$GROUP = PCache::read('group.php');
foreach($GROUP as $k=>$v){
	check('group-'.$k,$v['groupname'].'分组缓存');
}
echo '<hr>';
check('autoCategoryRank','汽车分级缓存和树文件缓存');
echo '<hr>';
$autoTypes = AutoCategory::getTypes();
foreach($autoTypes as $k=>$v){
	check('autoCategory-'.$k,'汽车缓存('.$v.')');
	check('autoCategoryTree-'.$k,'汽车[树文件]缓存('.$v.')');
}
echo '<hr>';

$table = Table::name(Table::NAME_FIELDS);
$result = $db->getAll("SELECT * FROM {$table}");
foreach($result as $v){
	check('fields-'.$v['tb'],$v['tb'].'[模块自定义字段]缓存');
}
echo '<hr>';
$table = Table::name(Table::NAME_AUTO_FIELDS);
$result = $db->getAll("SELECT distinct tb FROM {$table}");
foreach($result as $v){
	check('fields-'.$v['tb'],$v['tb'].'[车型库字段]缓存');
}
echo '<hr>';
$table = Table::name(Table::NAME_TYPE);
$result = $db->getAll("SELECT distinct item FROM {$table} WHERE item!='' AND cache=1 ORDER BY typeid DESC");
foreach($result as $v){
	check('type-'.$v['item'],$v['item'].'[type]缓存');
}

